home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / AppleTalk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  37.3 KB  |  1,143 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AppleTalk.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __APPLETALK__
  18. #define __APPLETALK__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <Memory.h>                                            */
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if GENERATINGPOWERPC
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #ifdef __CFM68K__
  41. #pragma lib_export on
  42. #endif
  43.  
  44.  
  45. enum {
  46. /* Driver unit and reference numbers (ADSP is dynamic) */
  47.     mppUnitNum                    = 9,                            /* MPP unit number */
  48.     atpUnitNum                    = 10,                            /* ATP unit number */
  49.     xppUnitNum                    = 40,                            /* XPP unit number */
  50.     mppRefNum                    = -10,                            /* MPP reference number */
  51.     atpRefNum                    = -11,                            /* ATP reference number */
  52.     xppRefNum                    = -41,                            /* XPP reference number */
  53. /* .MPP csCodes */
  54.     lookupReply                    = 242,                            /* This command queued to ourself */
  55.     writeLAP                    = 243,                            /* Write out LAP packet */
  56.     detachPH                    = 244,                            /* Detach LAP protocol handler */
  57.     attachPH                    = 245,                            /* Attach LAP protocol handler */
  58.     writeDDP                    = 246,                            /* Write out DDP packet */
  59.     closeSkt                    = 247,                            /* Close DDP socket */
  60.     openSkt                        = 248,                            /* Open DDP socket */
  61.     loadNBP                        = 249,                            /* Load NBP command-executing code */
  62.     lastResident                = 249,                            /* Last resident command */
  63.     confirmName                    = 250,                            /* Confirm name */
  64.     lookupName                    = 251,                            /* Look up name on internet */
  65.     removeName                    = 252,                            /* Remove name from Names Table */
  66.     registerName                = 253,                            /* Register name in Names Table */
  67.     killNBP                        = 254                            /* Kill outstanding NBP request */
  68. };
  69.  
  70. enum {
  71.     unloadNBP                    = 255,                            /* Unload NBP command code */
  72.     setSelfSend                    = 256,                            /* MPP: Set to allow writes to self */
  73.     SetMyZone                    = 257,                            /* Set my zone name */
  74.     GetATalkInfo                = 258,                            /* get AppleTalk information */
  75.     ATalkClosePrep                = 259,                            /* AppleTalk close query */
  76. /* .ATP csCodes */
  77.     nSendRequest                = 248,                            /* NSendRequest code */
  78.     relRspCB                    = 249,                            /* Release RspCB */
  79.     closeATPSkt                    = 250,                            /* Close ATP socket */
  80.     addResponse                    = 251,                            /* Add response code | Require open skt */
  81.     sendResponse                = 252,                            /* Send response code */
  82.     getRequest                    = 253,                            /* Get request code */
  83.     openATPSkt                    = 254,                            /* Open ATP socket */
  84.     sendRequest                    = 255,                            /* Send request code */
  85.     relTCB                        = 256,                            /* Release TCB */
  86.     killGetReq                    = 257,                            /* Kill GetRequest */
  87.     killSendReq                    = 258,                            /* Kill SendRequest */
  88.     killAllGetReq                = 259,                            /* Kill all getRequests for a skt */
  89. /* .XPP csCodes */
  90.     openSess                    = 255,                            /* Open session */
  91.     closeSess                    = 254,                            /* Close session */
  92.     userCommand                    = 253                            /* User command */
  93. };
  94.  
  95. enum {
  96.     userWrite                    = 252,                            /* User write */
  97.     getStatus                    = 251,                            /* Get status */
  98.     afpCall                        = 250,                            /* AFP command (buffer has command code) */
  99.     getParms                    = 249,                            /* Get parameters */
  100.     abortOS                        = 248,                            /* Abort open session request */
  101.     closeAll                    = 247,                            /* Close all open sessions */
  102.     xCall                        = 246,                            /* .XPP extended calls */
  103. /* Transition Queue transition types */
  104.     ATTransOpen                    = 0,                            /*AppleTalk has opened*/
  105.     ATTransClose                = 2,                            /*AppleTalk is about to close*/
  106.     ATTransClosePrep            = 3,                            /*Is it OK to close AppleTalk ?*/
  107.     ATTransCancelClose            = 4,                            /*Cancel the ClosePrep transition*/
  108.     afpByteRangeLock            = 1,                            /*AFPCall command codes*/
  109.     afpVolClose                    = 2,                            /*AFPCall command codes*/
  110.     afpDirClose                    = 3,                            /*AFPCall command codes*/
  111.     afpForkClose                = 4,                            /*AFPCall command codes*/
  112.     afpCopyFile                    = 5,                            /*AFPCall command codes*/
  113.     afpDirCreate                = 6,                            /*AFPCall command codes*/
  114.     afpFileCreate                = 7,                            /*AFPCall command codes*/
  115.     afpDelete                    = 8,                            /*AFPCall command codes*/
  116.     afpEnumerate                = 9                                /*AFPCall command codes*/
  117. };
  118.  
  119. enum {
  120.     afpFlush                    = 10,                            /*AFPCall command codes*/
  121.     afpForkFlush                = 11,                            /*AFPCall command codes*/
  122.     afpGetDirParms                = 12,                            /*AFPCall command codes*/
  123.     afpGetFileParms                = 13,                            /*AFPCall command codes*/
  124.     afpGetForkParms                = 14,                            /*AFPCall command codes*/
  125.     afpGetSInfo                    = 15,                            /*AFPCall command codes*/
  126.     afpGetSParms                = 16,                            /*AFPCall command codes*/
  127.     afpGetVolParms                = 17,                            /*AFPCall command codes*/
  128.     afpLogin                    = 18,                            /*AFPCall command codes*/
  129.     afpContLogin                = 19,                            /*AFPCall command codes*/
  130.     afpLogout                    = 20,                            /*AFPCall command codes*/
  131.     afpMapID                    = 21,                            /*AFPCall command codes*/
  132.     afpMapName                    = 22,                            /*AFPCall command codes*/
  133.     afpMove                        = 23,                            /*AFPCall command codes*/
  134.     afpOpenVol                    = 24,                            /*AFPCall command codes*/
  135.     afpOpenDir                    = 25,                            /*AFPCall command codes*/
  136.     afpOpenFork                    = 26,                            /*AFPCall command codes*/
  137.     afpRead                        = 27,                            /*AFPCall command codes*/
  138.     afpRename                    = 28,                            /*AFPCall command codes*/
  139.     afpSetDirParms                = 29                            /*AFPCall command codes*/
  140. };
  141.  
  142. enum {
  143.     afpSetFileParms                = 30,                            /*AFPCall command codes*/
  144.     afpSetForkParms                = 31,                            /*AFPCall command codes*/
  145.     afpSetVolParms                = 32,                            /*AFPCall command codes*/
  146.     afpWrite                    = 33,                            /*AFPCall command codes*/
  147.     afpGetFlDrParms                = 34,                            /*AFPCall command codes*/
  148.     afpSetFlDrParms                = 35,                            /*AFPCall command codes*/
  149.     afpDTOpen                    = 48,                            /*AFPCall command codes*/
  150.     afpDTClose                    = 49,                            /*AFPCall command codes*/
  151.     afpGetIcon                    = 51,                            /*AFPCall command codes*/
  152.     afpGtIcnInfo                = 52,                            /*AFPCall command codes*/
  153.     afpAddAPPL                    = 53,                            /*AFPCall command codes*/
  154.     afpRmvAPPL                    = 54,                            /*AFPCall command codes*/
  155.     afpGetAPPL                    = 55,                            /*AFPCall command codes*/
  156.     afpAddCmt                    = 56,                            /*AFPCall command codes*/
  157.     afpRmvCmt                    = 57,                            /*AFPCall command codes*/
  158.     afpGetCmt                    = 58,                            /*AFPCall command codes*/
  159.     afpAddIcon                    = 192,                            /*Special code for ASP Write commands*/
  160.     xppLoadedBit                = 5,                            /* XPP bit in PortBUse */
  161.     scbMemSize                    = 192,                            /* Size of memory for SCB */
  162.     xppFlagClr                    = 0                                /* Cs for AFPCommandBlock */
  163. };
  164.  
  165. enum {
  166.     xppFlagSet                    = 128,                            /* StartEndFlag & NewLineFlag fields. */
  167.     lapSize                        = 20,
  168.     ddpSize                        = 26,
  169.     nbpSize                        = 26,
  170.     atpSize                        = 56,
  171.     atpXOvalue                    = 32,                            /*ATP exactly-once bit */
  172.     atpEOMvalue                    = 16,                            /*ATP End-Of-Message bit */
  173.     atpSTSvalue                    = 8,                            /*ATP Send-Transmission-Status bit */
  174.     atpTIDValidvalue            = 2,                            /*ATP trans. ID valid bit */
  175.     atpSendChkvalue                = 1,                            /*ATP send checksum bit */
  176.     zipGetLocalZones            = 5,
  177.     zipGetZoneList                = 6,
  178.     zipGetMyZone                = 7,
  179.     LAPMgrPtr                    = 0xB18,                        /*Entry point for LAP Manager*/
  180.     LAPMgrCall                    = 2,                            /*Offset to LAP routines*/
  181.     LAddAEQ                        = 23,                            /*LAPAddATQ routine selector*/
  182.     LRmvAEQ                        = 24                            /*LAPRmvATQ routine selector*/
  183. };
  184.  
  185. #define MPPioCompletion MPP.ioCompletion
  186. #define MPPioResult MPP.ioResult
  187. #define MPPioRefNum MPP.ioRefNum
  188. #define MPPcsCode MPP.csCode
  189. #define LAPprotType LAP.protType
  190. #define LAPwdsPointer LAP.u.wdsPointer
  191. #define LAPhandler LAP.u.handler
  192. #define DDPsocket DDP.socket
  193. #define DDPchecksumFlag DDP.checksumFlag
  194. #define DDPwdsPointer DDP.u.wdsPointer
  195. #define DDPlistener DDP.u.listener
  196. #define NBPinterval NBP.interval
  197. #define NBPcount NBP.count
  198. #define NBPntQElPtr NBP.nbpPtrs.ntQElPtr
  199. #define NBPentityPtr NBP.nbpPtrs.entityPtr
  200. #define NBPverifyFlag NBP.parm.verifyFlag
  201. #define NBPretBuffPtr NBP.parm.Lookup.retBuffPtr
  202. #define NBPretBuffSize NBP.parm.Lookup.retBuffSize
  203. #define NBPmaxToGet NBP.parm.Lookup.maxToGet
  204. #define NBPnumGotten NBP.parm.Lookup.numGotten
  205. #define NBPconfirmAddr NBP.parm.Confirm.confirmAddr
  206. #define NBPnKillQEl NBPKILL.nKillQEl
  207. #define NBPnewSocket NBP.parm.Confirm.newSocket
  208. #define ATPioCompletion ATP.ioCompletion
  209. #define ATPioResult ATP.ioResult
  210. #define ATPuserData ATP.userData
  211. #define ATPreqTID ATP.reqTID
  212. #define ATPioRefNum ATP.ioRefNum
  213. #define ATPcsCode ATP.csCode
  214. #define ATPatpSocket ATP.atpSocket
  215. #define ATPatpFlags ATP.atpFlags
  216. #define ATPaddrBlock ATP.addrBlock
  217. #define ATPreqLength ATP.reqLength
  218. #define ATPreqPointer ATP.reqPointer
  219. #define ATPbdsPointer ATP.bdsPointer
  220. #define ATPtimeOutVal SREQ.timeOutVal
  221. #define ATPnumOfResps SREQ.numOfResps
  222. #define ATPretryCount SREQ.retryCount
  223. #define ATPnumOfBuffs OTH1.u.numOfBuffs
  224. #define ATPbitMap OTH1.u.bitMap
  225. #define ATPrspNum OTH1.u.rspNum
  226. #define ATPbdsSize OTH2.bdsSize
  227. #define ATPtransID OTH2.transID
  228. #define ATPaKillQEl KILL.aKillQEl
  229. enum {
  230.     tLAPRead,
  231.     tLAPWrite,
  232.     tDDPRead,
  233.     tDDPWrite,
  234.     tNBPLookup,
  235.     tNBPConfirm,
  236.     tNBPRegister,
  237.     tATPSndRequest,
  238.     tATPGetRequest,
  239.     tATPSdRsp,
  240.     tATPAddRsp,
  241.     tATPRequest,
  242.     tATPResponse
  243. };
  244.  
  245. typedef SInt8 ABCallType;
  246.  
  247.  
  248. enum {
  249.     lapProto,
  250.     ddpProto,
  251.     nbpProto,
  252.     atpProto
  253. };
  254.  
  255. typedef UInt8 ABProtoType;
  256.  
  257. typedef Byte ABByte;
  258.  
  259. struct LAPAdrBlock {
  260.     UInt8                            dstNodeID;
  261.     UInt8                            srcNodeID;
  262.     ABByte                            lapProtType;
  263.     UInt8                            filler;                        /*    Filler for proper byte alignment*/
  264. };
  265. typedef struct LAPAdrBlock LAPAdrBlock;
  266.  
  267. typedef struct ATQEntry ATQEntry, *ATQEntryPtr;
  268.  
  269. typedef long (*ATalkTransitionEventProcPtr)(long eventCode, ATQEntryPtr qElem, void *eventParameter);
  270.  
  271. #if GENERATINGCFM
  272. typedef UniversalProcPtr ATalkTransitionEventUPP;
  273. #else
  274. typedef ATalkTransitionEventProcPtr ATalkTransitionEventUPP;
  275. #endif
  276.  
  277. typedef ATalkTransitionEventUPP ATalkTransitionEvent;
  278.  
  279. struct ATQEntry {
  280.     ATQEntry                        *qLink;                        /*next queue entry*/
  281.     short                            qType;                        /*queue type*/
  282.     ATalkTransitionEventUPP            CallAddr;                    /*your routine descriptor*/
  283. };
  284. struct AddrBlock {
  285.     UInt16                            aNet;
  286.     UInt8                            aNode;
  287.     UInt8                            aSocket;
  288. };
  289. typedef struct AddrBlock AddrBlock;
  290.  
  291. /* Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  292. offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  293. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  294. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  295. be the same, which is OK since they are not used. */
  296. struct EntityName {
  297.     Str32                            objStr;
  298.     SInt8                            pad1;                        /*Str32's aligned on even word boundries.*/
  299.     Str32                            typeStr;
  300.     SInt8                            pad2;
  301.     Str32                            zoneStr;
  302.     SInt8                            pad3;
  303. };
  304. typedef struct EntityName EntityName;
  305.  
  306. typedef EntityName *EntityPtr;
  307.  
  308. struct RetransType {
  309.     UInt8                            retransInterval;
  310.     UInt8                            retransCount;
  311. };
  312. typedef struct RetransType RetransType;
  313.  
  314. struct BDSElement {
  315.     short                            buffSize;
  316.     Ptr                                buffPtr;
  317.     short                            dataSize;
  318.     long                            userBytes;
  319. };
  320. typedef struct BDSElement BDSElement;
  321.  
  322. typedef BDSElement BDSType[8];
  323.  
  324. typedef BDSElement *BDSPtr;
  325.  
  326. typedef char BitMapType;
  327.  
  328. struct ATLAPRec {
  329.     ABCallType                        abOpcode;
  330.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  331.     short                            abResult;
  332.     long                            abUserReference;
  333.     LAPAdrBlock                        lapAddress;
  334.     short                            lapReqCount;
  335.     short                            lapActCount;
  336.     Ptr                                lapDataPtr;
  337. };
  338. typedef struct ATLAPRec ATLAPRec;
  339.  
  340. typedef ATLAPRec *ATLAPRecPtr, **ATLAPRecHandle;
  341.  
  342. struct ATDDPRec {
  343.     ABCallType                        abOpcode;
  344.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  345.     short                            abResult;
  346.     long                            abUserReference;
  347.     short                            ddpType;
  348.     short                            ddpSocket;
  349.     AddrBlock                        ddpAddress;
  350.     short                            ddpReqCount;
  351.     short                            ddpActCount;
  352.     Ptr                                ddpDataPtr;
  353.     short                            ddpNodeID;
  354. };
  355. typedef struct ATDDPRec ATDDPRec;
  356.  
  357. typedef ATDDPRec *ATDDPRecPtr, **ATDDPRecHandle;
  358.  
  359. struct ATNBPRec {
  360.     ABCallType                        abOpcode;
  361.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  362.     short                            abResult;
  363.     long                            abUserReference;
  364.     EntityPtr                        nbpEntityPtr;
  365.     Ptr                                nbpBufPtr;
  366.     short                            nbpBufSize;
  367.     short                            nbpDataField;
  368.     AddrBlock                        nbpAddress;
  369.     RetransType                        nbpRetransmitInfo;
  370. };
  371. typedef struct ATNBPRec ATNBPRec;
  372.  
  373. typedef ATNBPRec *ATNBPRecPtr, **ATNBPRecHandle;
  374.  
  375. struct ATATPRec {
  376.     ABCallType                        abOpcode;
  377.     SInt8                            filler1;                    /*    Filler for proper byte alignment*/
  378.     short                            abResult;
  379.     long                            abUserReference;
  380.     short                            atpSocket;
  381.     AddrBlock                        atpAddress;
  382.     short                            atpReqCount;
  383.     Ptr                                atpDataPtr;
  384.     BDSPtr                            atpRspBDSPtr;
  385.     BitMapType                        atpBitMap;
  386.     UInt8                            filler2;                    /*    Filler for proper byte alignment*/
  387.     short                            atpTransID;
  388.     short                            atpActCount;
  389.     long                            atpUserData;
  390.     Boolean                            atpXO;
  391.     Boolean                            atpEOM;
  392.     short                            atpTimeOut;
  393.     short                            atpRetries;
  394.     short                            atpNumBufs;
  395.     short                            atpNumRsp;
  396.     short                            atpBDSSize;
  397.     long                            atpRspUData;
  398.     Ptr                                atpRspBuf;
  399.     short                            atpRspSize;
  400. };
  401. typedef struct ATATPRec ATATPRec;
  402.  
  403. typedef ATATPRec *ATATPRecPtr, **ATATPRecHandle;
  404.  
  405. struct AFPCommandBlock {
  406.     UInt8                            cmdByte;
  407.     UInt8                            startEndFlag;
  408.     short                            forkRefNum;
  409.     long                            rwOffset;
  410.     long                            reqCount;
  411.     UInt8                            newLineFlag;
  412.     char                            newLineChar;
  413. };
  414. typedef struct AFPCommandBlock AFPCommandBlock;
  415.  
  416. typedef union MPPParamBlock MPPParamBlock, *MPPPBPtr;
  417.  
  418. typedef union ATPParamBlock ATPParamBlock, *ATPPBPtr;
  419.  
  420. typedef union XPPParamBlock XPPParamBlock, *XPPParmBlkPtr;
  421.  
  422. /*
  423.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  424.         be written in or called from a high-level language without the help of
  425.         mixed mode or assembly glue.
  426.  
  427.         In:
  428.          => thePBptr        A0.L
  429. */
  430. /*
  431.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  432.         be written in or called from a high-level language without the help of
  433.         mixed mode or assembly glue.
  434.  
  435.         In:
  436.          => thePBptr        A0.L
  437. */
  438. /*
  439.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  440.         be written in or called from a high-level language without the help of
  441.         mixed mode or assembly glue.
  442.  
  443.         In:
  444.          => thePBptr        A0.L
  445. */
  446. /*
  447.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  448.         be written in or called from a high-level language without the help of
  449.         mixed mode or assembly glue.
  450.  
  451.         In:
  452.          => sessRefnum      D0.W
  453.          => attnBytes       D1.W
  454. */
  455.  
  456. #if GENERATINGCFM
  457. typedef UniversalProcPtr MPPCompletionUPP;
  458. typedef UniversalProcPtr ATPCompletionUPP;
  459. typedef UniversalProcPtr XPPCompletionUPP;
  460. typedef UniversalProcPtr AttnRoutineUPP;
  461. #else
  462. typedef Register68kProcPtr MPPCompletionUPP;
  463. typedef Register68kProcPtr ATPCompletionUPP;
  464. typedef Register68kProcPtr XPPCompletionUPP;
  465. typedef Register68kProcPtr AttnRoutineUPP;
  466. #endif
  467.  
  468. struct WDSElement {
  469.     short                            entryLength;
  470.     Ptr                                entryPtr;
  471. };
  472. typedef struct WDSElement WDSElement;
  473.  
  474. struct NTElement {
  475.     AddrBlock                        nteAddress;                    /*network address of entity*/
  476.     SInt8                            filler;
  477.     SInt8                            entityData[99];                /*Object, Type & Zone*/
  478. };
  479. typedef struct NTElement NTElement;
  480.  
  481. struct NamesTableEntry {
  482.     Ptr                                qNext;                        /*ptr to next NTE*/
  483.     NTElement                        nt;
  484. };
  485. typedef struct NamesTableEntry NamesTableEntry;
  486.  
  487. #define XPPPBHeader             \
  488.     QElem *qLink;                \
  489.     short qType;                \
  490.     short ioTrap;                \
  491.     Ptr ioCmdAddr;                \
  492.     XPPCompletionUPP ioCompletion; \
  493.     OSErr ioResult;                \
  494.     long cmdResult;                \
  495.     short ioVRefNum;            \
  496.     short ioRefNum;                \
  497.     short csCode;
  498. typedef Boolean (*MPPProtocolHandlerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, short numBytesLeftToReadInPacket);
  499. typedef Boolean (*DDPSocketListenerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, UInt8 packetDestinationNumber, short numBytesLeftToReadInPacket);
  500.  
  501. #if GENERATINGCFM
  502. typedef UniversalProcPtr MPPProtocolHandlerUPP;
  503. typedef UniversalProcPtr DDPSocketListenerUPP;
  504. #else
  505. typedef Register68kProcPtr MPPProtocolHandlerUPP;
  506. typedef Register68kProcPtr DDPSocketListenerUPP;
  507. #endif
  508.  
  509. struct MPPparms {
  510.     QElem                            *qLink;
  511.     short                            qType;
  512.     short                            ioTrap;
  513.     Ptr                                ioCmdAddr;
  514.     ATPCompletionUPP                ioCompletion;
  515.     OSErr                            ioResult;
  516.     long                            userData;
  517.     short                            reqTID;
  518.     short                            ioRefNum;
  519.     short                            csCode;
  520. };
  521. typedef struct MPPparms MPPparms;
  522.  
  523. struct LAPparms {
  524.     QElem                            *qLink;
  525.     short                            qType;
  526.     short                            ioTrap;
  527.     Ptr                                ioCmdAddr;
  528.     ATPCompletionUPP                ioCompletion;
  529.     OSErr                            ioResult;
  530.     long                            userData;
  531.     short                            reqTID;
  532.     short                            ioRefNum;
  533.     short                            csCode;
  534.     UInt8                            protType;                    /*ALAP protocol Type */
  535.     UInt8                            filler;
  536.     union {
  537.         Ptr                                wdsPointer;                /*-> write data structure*/
  538.         MPPProtocolHandlerUPP            handler;                /*-> protocol handler routine*/
  539.     } u;
  540. };
  541.  
  542. typedef struct LAPparms LAPparms;
  543.  
  544. struct DDPparms {
  545.     QElem                            *qLink;
  546.     short                            qType;
  547.     short                            ioTrap;
  548.     Ptr                                ioCmdAddr;
  549.     ATPCompletionUPP                ioCompletion;
  550.     OSErr                            ioResult;
  551.     long                            userData;
  552.     short                            reqTID;
  553.     short                            ioRefNum;
  554.     short                            csCode;
  555.     UInt8                            socket;                        /*socket number */
  556.     UInt8                            checksumFlag;                /*check sum flag */
  557.     union {
  558.         Ptr                                wdsPointer;                /*-> write data structure*/
  559.         DDPSocketListenerUPP            listener;                /*->write data structure or -> Listener*/
  560.     } u;
  561. };
  562.  
  563. typedef struct DDPparms DDPparms;
  564.  
  565. union NBPPtrs {
  566.     Ptr                                ntQElPtr;
  567.     Ptr                                entityPtr;
  568. };
  569. typedef union NBPPtrs NBPPtrs;
  570.  
  571. union LookupConfirmParams {
  572.     UInt8                            verifyFlag;
  573.         struct {
  574.             Ptr                                retBuffPtr;
  575.             short                            retBuffSize;
  576.             short                            maxToGet;
  577.             short                            numGotten;
  578.         }                            Lookup;
  579.         struct {
  580.             AddrBlock                        confirmAddr;
  581.             UInt8                            newSocket;
  582.             UInt8                            filler;                /*    Filler for proper byte alignment*/
  583.         }                            Confirm;
  584. };
  585. typedef union LookupConfirmParams LookupConfirmParams;
  586.  
  587. struct NBPparms {
  588.     QElem                            *qLink;
  589.     short                            qType;
  590.     short                            ioTrap;
  591.     Ptr                                ioCmdAddr;
  592.     ATPCompletionUPP                ioCompletion;
  593.     OSErr                            ioResult;
  594.     long                            userData;
  595.     short                            reqTID;
  596.     short                            ioRefNum;
  597.     short                            csCode;
  598.     UInt8                            interval;                    /*retry interval */
  599.     UInt8                            count;                        /*retry count */
  600.     NBPPtrs                            nbpPtrs;
  601.     LookupConfirmParams                parm;
  602. };
  603. typedef struct NBPparms NBPparms;
  604.  
  605. struct SetSelfparms {
  606.     QElem                            *qLink;
  607.     short                            qType;
  608.     short                            ioTrap;
  609.     Ptr                                ioCmdAddr;
  610.     ATPCompletionUPP                ioCompletion;
  611.     OSErr                            ioResult;
  612.     long                            userData;
  613.     short                            reqTID;
  614.     short                            ioRefNum;
  615.     short                            csCode;
  616.     UInt8                            newSelfFlag;                /*self-send toggle flag */
  617.     UInt8                            oldSelfFlag;                /*previous self-send state */
  618. };
  619. typedef struct SetSelfparms SetSelfparms;
  620.  
  621. struct NBPKillparms {
  622.     QElem                            *qLink;
  623.     short                            qType;
  624.     short                            ioTrap;
  625.     Ptr                                ioCmdAddr;
  626.     ATPCompletionUPP                ioCompletion;
  627.     OSErr                            ioResult;
  628.     long                            userData;
  629.     short                            reqTID;
  630.     short                            ioRefNum;
  631.     short                            csCode;
  632.     Ptr                                nKillQEl;                    /*ptr to i/o queue element to cancel */
  633. };
  634. typedef struct NBPKillparms NBPKillparms;
  635.  
  636. struct GetAppleTalkInfoParm {
  637.     QElem                            *qLink;
  638.     short                            qType;
  639.     short                            ioTrap;
  640.     Ptr                                ioCmdAddr;
  641.     ATPCompletionUPP                ioCompletion;
  642.     OSErr                            ioResult;
  643.     long                            userData;
  644.     short                            reqTID;
  645.     short                            ioRefNum;
  646.     short                            csCode;
  647.     short                            version;
  648.     Ptr                                varsPtr;
  649.     Ptr                                DCEPtr;
  650.     short                            portID;
  651.     long                            configuration;
  652.     short                            selfSend;
  653.     short                            netLo;
  654.     short                            netHi;
  655.     long                            ourAdd;
  656.     long                            routerAddr;
  657.     short                            numOfPHs;
  658.     short                            numOfSkts;
  659.     short                            numNBPEs;
  660.     Ptr                                nTQueue;
  661.     short                            LAlength;
  662.     Ptr                                linkAddr;
  663.     Ptr                                zoneName;
  664. };
  665. typedef struct GetAppleTalkInfoParm GetAppleTalkInfoParm;
  666.  
  667. struct ATalkClosePrepParm {
  668.     QElem                            *qLink;
  669.     short                            qType;
  670.     short                            ioTrap;
  671.     Ptr                                ioCmdAddr;
  672.     ATPCompletionUPP                ioCompletion;
  673.     OSErr                            ioResult;
  674.     long                            userData;
  675.     short                            reqTID;
  676.     short                            ioRefNum;
  677.     short                            csCode;
  678.     Ptr                                appName;                    /*pointer to application name in buffer*/
  679. };
  680. typedef struct ATalkClosePrepParm ATalkClosePrepParm;
  681.  
  682. union MPPParamBlock {
  683.     MPPparms                        MPP;                        /*General MPP parms*/
  684.     LAPparms                        LAP;                        /*ALAP calls*/
  685.     DDPparms                        DDP;                        /*DDP calls*/
  686.     NBPparms                        NBP;                        /*NBP calls*/
  687.     SetSelfparms                    SETSELF;
  688.     NBPKillparms                    NBPKILL;
  689.     GetAppleTalkInfoParm            GAIINFO;
  690.     ATalkClosePrepParm                ATALKCLOSE;
  691. };
  692. struct XPPPrmBlk {
  693.     QElem                            *qLink;
  694.     short                            qType;
  695.     short                            ioTrap;
  696.     Ptr                                ioCmdAddr;
  697.     XPPCompletionUPP                ioCompletion;
  698.     OSErr                            ioResult;
  699.     long                            cmdResult;
  700.     short                            ioVRefNum;
  701.     short                            ioRefNum;
  702.     short                            csCode;
  703.     short                            sessRefnum;
  704.     UInt8                            aspTimeout;
  705.     UInt8                            aspRetry;
  706.     short                            cbSize;
  707.     Ptr                                cbPtr;
  708.     short                            rbSize;
  709.     Ptr                                rbPtr;
  710.     short                            wdSize;
  711.     Ptr                                wdPtr;
  712.     UInt8                            ccbStart[296];
  713. };
  714. typedef struct XPPPrmBlk XPPPrmBlk;
  715.  
  716. struct ASPGetparmsBlk {
  717.     QElem                            *qLink;
  718.     short                            qType;
  719.     short                            ioTrap;
  720.     Ptr                                ioCmdAddr;
  721.     XPPCompletionUPP                ioCompletion;
  722.     OSErr                            ioResult;
  723.     long                            cmdResult;
  724.     short                            ioVRefNum;
  725.     short                            ioRefNum;
  726.     short                            csCode;
  727.     short                            aspMaxCmdSize;
  728.     short                            aspQuantumSize;
  729.     short                            numSesss;
  730. };
  731. typedef struct ASPGetparmsBlk ASPGetparmsBlk;
  732.  
  733. struct ASPAbortPrm {
  734.     QElem                            *qLink;
  735.     short                            qType;
  736.     short                            ioTrap;
  737.     Ptr                                ioCmdAddr;
  738.     XPPCompletionUPP                ioCompletion;
  739.     OSErr                            ioResult;
  740.     long                            cmdResult;
  741.     short                            ioVRefNum;
  742.     short                            ioRefNum;
  743.     short                            csCode;
  744.     Ptr                                abortSCBPtr;                /*SCB pointer for AbortOS */
  745. };
  746. typedef struct ASPAbortPrm ASPAbortPrm;
  747.  
  748. struct ASPOpenPrm {
  749.     QElem                            *qLink;
  750.     short                            qType;
  751.     short                            ioTrap;
  752.     Ptr                                ioCmdAddr;
  753.     XPPCompletionUPP                ioCompletion;
  754.     OSErr                            ioResult;
  755.     long                            cmdResult;
  756.     short                            ioVRefNum;
  757.     short                            ioRefNum;
  758.     short                            csCode;
  759.     short                            sessRefnum;
  760.     UInt8                            aspTimeout;
  761.     UInt8                            aspRetry;
  762.     AddrBlock                        serverAddr;
  763.     Ptr                                scbPointer;
  764.     AttnRoutineUPP                    attnRoutine;
  765. };
  766. typedef struct ASPOpenPrm ASPOpenPrm, *ASPOpenPrmPtr;
  767.  
  768. struct AFPLoginPrm {
  769.     QElem                            *qLink;
  770.     short                            qType;
  771.     short                            ioTrap;
  772.     Ptr                                ioCmdAddr;
  773.     XPPCompletionUPP                ioCompletion;
  774.     OSErr                            ioResult;
  775.     long                            cmdResult;
  776.     short                            ioVRefNum;
  777.     short                            ioRefNum;
  778.     short                            csCode;
  779.     short                            sessRefnum;
  780.     UInt8                            aspTimeout;
  781.     UInt8                            aspRetry;
  782.     short                            cbSize;
  783.     Ptr                                cbPtr;
  784.     short                            rbSize;
  785.     Ptr                                rbPtr;
  786.     AddrBlock                        afpAddrBlock;
  787.     Ptr                                afpSCBPtr;
  788.     Ptr                                afpAttnRoutine;
  789.     UInt8                            ccbFill[144];                /*CCB memory allocated for driver  Login needs only 150 bytes BUT CCB really starts in the middle of AFPSCBPtr and also clobbers AFPAttnRoutine. */
  790. };
  791. typedef struct AFPLoginPrm AFPLoginPrm;
  792.  
  793. struct XCallParam {
  794.     QElem                            *qLink;
  795.     short                            qType;
  796.     short                            ioTrap;
  797.     Ptr                                ioCmdAddr;
  798.     XPPCompletionUPP                ioCompletion;
  799.     OSErr                            ioResult;
  800.     long                            cmdResult;
  801.     short                            ioVRefNum;
  802.     short                            ioRefNum;
  803.     short                            csCode;
  804.     short                            xppSubCode;
  805.     UInt8                            xppTimeout;
  806.     UInt8                            xppRetry;
  807.     short                            filler1;
  808.     Ptr                                zipBuffPtr;
  809.     short                            zipNumZones;
  810.     UInt8                            zipLastFlag;
  811.     UInt8                            filler2;
  812.     UInt8                            zipInfoField[70];
  813. };
  814. typedef struct XCallParam XCallParam;
  815.  
  816. union XPPParamBlock {
  817.     XPPPrmBlk                        XPP;
  818.     ASPGetparmsBlk                    GETPARM;
  819.     ASPAbortPrm                        ABORT;
  820.     ASPOpenPrm                        OPEN;
  821.     AFPLoginPrm                        LOGIN;
  822.     XCallParam                        XCALL;
  823. };
  824. #define MOREATPHeader             \
  825.     UInt8 atpSocket;                \
  826.     UInt8 atpFlags;                \
  827.     AddrBlock addrBlock;            \
  828.     short reqLength;                \
  829.     Ptr reqPointer;                \
  830.     Ptr bdsPointer;
  831. struct ATPparms {
  832.     QElem                            *qLink;
  833.     short                            qType;
  834.     short                            ioTrap;
  835.     Ptr                                ioCmdAddr;
  836.     ATPCompletionUPP                ioCompletion;
  837.     OSErr                            ioResult;
  838.     long                            userData;
  839.     short                            reqTID;
  840.     short                            ioRefNum;
  841.     short                            csCode;
  842.     UInt8                            atpSocket;
  843.     UInt8                            atpFlags;
  844.     AddrBlock                        addrBlock;
  845.     short                            reqLength;
  846.     Ptr                                reqPointer;
  847.     Ptr                                bdsPointer;
  848. };
  849. typedef struct ATPparms ATPparms;
  850.  
  851. struct SendReqparms {
  852.     QElem                            *qLink;
  853.     short                            qType;
  854.     short                            ioTrap;
  855.     Ptr                                ioCmdAddr;
  856.     ATPCompletionUPP                ioCompletion;
  857.     OSErr                            ioResult;
  858.     long                            userData;
  859.     short                            reqTID;
  860.     short                            ioRefNum;
  861.     short                            csCode;
  862.     UInt8                            atpSocket;
  863.     UInt8                            atpFlags;
  864.     AddrBlock                        addrBlock;
  865.     short                            reqLength;
  866.     Ptr                                reqPointer;
  867.     Ptr                                bdsPointer;
  868.     UInt8                            numOfBuffs;
  869.     UInt8                            timeOutVal;
  870.     UInt8                            numOfResps;
  871.     UInt8                            retryCount;
  872.     short                            intBuff;
  873.     UInt8                            TRelTime;
  874.     SInt8                            filler0;
  875. };
  876. typedef struct SendReqparms SendReqparms;
  877.  
  878. struct ATPmisc1 {
  879.     QElem                            *qLink;
  880.     short                            qType;
  881.     short                            ioTrap;
  882.     Ptr                                ioCmdAddr;
  883.     ATPCompletionUPP                ioCompletion;
  884.     OSErr                            ioResult;
  885.     long                            userData;
  886.     short                            reqTID;
  887.     short                            ioRefNum;
  888.     short                            csCode;
  889.     UInt8                            atpSocket;
  890.     UInt8                            atpFlags;
  891.     AddrBlock                        addrBlock;
  892.     short                            reqLength;
  893.     Ptr                                reqPointer;
  894.     Ptr                                bdsPointer;
  895.     union {
  896.         UInt8                            bitMap;                    /*bitmap received */
  897.         UInt8                            numOfBuffs;                /*number of responses being sent*/
  898.         UInt8                            rspNum;                    /*sequence number*/
  899.     } u;
  900. };
  901.  
  902. typedef struct ATPmisc1 ATPmisc1;
  903.  
  904. struct ATPmisc2 {
  905.     QElem                            *qLink;
  906.     short                            qType;
  907.     short                            ioTrap;
  908.     Ptr                                ioCmdAddr;
  909.     ATPCompletionUPP                ioCompletion;
  910.     OSErr                            ioResult;
  911.     long                            userData;
  912.     short                            reqTID;
  913.     short                            ioRefNum;
  914.     short                            csCode;
  915.     UInt8                            atpSocket;
  916.     UInt8                            atpFlags;
  917.     AddrBlock                        addrBlock;
  918.     short                            reqLength;
  919.     Ptr                                reqPointer;
  920.     Ptr                                bdsPointer;
  921.     UInt8                            filler;
  922.     UInt8                            bdsSize;
  923.     short                            transID;
  924. };
  925. typedef struct ATPmisc2 ATPmisc2;
  926.  
  927. struct Killparms {
  928.     QElem                            *qLink;
  929.     short                            qType;
  930.     short                            ioTrap;
  931.     Ptr                                ioCmdAddr;
  932.     ATPCompletionUPP                ioCompletion;
  933.     OSErr                            ioResult;
  934.     long                            userData;
  935.     short                            reqTID;
  936.     short                            ioRefNum;
  937.     short                            csCode;
  938.     UInt8                            atpSocket;
  939.     UInt8                            atpFlags;
  940.     AddrBlock                        addrBlock;
  941.     short                            reqLength;
  942.     Ptr                                reqPointer;
  943.     Ptr                                bdsPointer;
  944.     Ptr                                aKillQEl;
  945. };
  946. typedef struct Killparms Killparms;
  947.  
  948. union ATPParamBlock {
  949.     ATPparms                        ATP;                        /*General ATP parms*/
  950.     SendReqparms                    SREQ;                        /*sendrequest parms*/
  951.     ATPmisc1                        OTH1;                        /*and a few others*/
  952.     ATPmisc2                        OTH2;                        /*and a few others*/
  953.     Killparms                        KILL;                        /*and a few others*/
  954. };
  955.  
  956. #if GENERATINGCFM
  957. #else
  958. #endif
  959.  
  960. enum {
  961.     uppATalkTransitionEventProcInfo = kCStackBased
  962.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  963.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  964.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ATQEntryPtr)))
  965.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*))),
  966.     uppMPPCompletionProcInfo = kRegisterBased
  967.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(MPPPBPtr))),
  968.     uppATPCompletionProcInfo = kRegisterBased
  969.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(ATPPBPtr))),
  970.     uppXPPCompletionProcInfo = kRegisterBased
  971.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(XPPParmBlkPtr))),
  972.     uppAttnRoutineProcInfo = kRegisterBased
  973.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
  974.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterD1, SIZE_CODE(sizeof(short))),
  975.     uppMPPProtocolHandlerProcInfo = SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ),
  976.     uppDDPSocketListenerProcInfo = SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener )
  977. };
  978.  
  979. #if GENERATINGCFM
  980. #define NewATalkTransitionEventProc(userRoutine)        \
  981.         (ATalkTransitionEventUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, GetCurrentArchitecture())
  982. #define NewMPPCompletionProc(userRoutine)        \
  983.         (MPPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPCompletionProcInfo, GetCurrentArchitecture())
  984. #define NewATPCompletionProc(userRoutine)        \
  985.         (ATPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATPCompletionProcInfo, GetCurrentArchitecture())
  986. #define NewXPPCompletionProc(userRoutine)        \
  987.         (XPPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppXPPCompletionProcInfo, GetCurrentArchitecture())
  988. #define NewAttnRoutineProc(userRoutine)        \
  989.         (AttnRoutineUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppAttnRoutineProcInfo, GetCurrentArchitecture())
  990. #define NewMPPProtocolHandlerProc(userRoutine)        \
  991.         (MPPProtocolHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPProtocolHandlerProcInfo, GetCurrentArchitecture())
  992. #define NewDDPSocketListenerProc(userRoutine)        \
  993.         (DDPSocketListenerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDDPSocketListenerProcInfo, GetCurrentArchitecture())
  994. #else
  995. #define NewATalkTransitionEventProc(userRoutine)        \
  996.         ((ATalkTransitionEventUPP) (userRoutine))
  997. #define NewMPPCompletionProc(userRoutine)        \
  998.         ((MPPCompletionUPP) (userRoutine))
  999. #define NewATPCompletionProc(userRoutine)        \
  1000.         ((ATPCompletionUPP) (userRoutine))
  1001. #define NewXPPCompletionProc(userRoutine)        \
  1002.         ((XPPCompletionUPP) (userRoutine))
  1003. #define NewAttnRoutineProc(userRoutine)        \
  1004.         ((AttnRoutineUPP) (userRoutine))
  1005. #define NewMPPProtocolHandlerProc(userRoutine)        \
  1006.         ((MPPProtocolHandlerUPP) (userRoutine))
  1007. #define NewDDPSocketListenerProc(userRoutine)        \
  1008.         ((DDPSocketListenerUPP) (userRoutine))
  1009. #endif
  1010.  
  1011. #if GENERATINGCFM
  1012. #define CallATalkTransitionEventProc(userRoutine, eventCode, qElem, eventParameter)        \
  1013.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, (eventCode), (qElem), (eventParameter))
  1014. #define CallMPPCompletionProc(userRoutine, thePBptr)        \
  1015.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMPPCompletionProcInfo, (thePBptr))
  1016. #define CallATPCompletionProc(userRoutine, thePBptr)        \
  1017.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATPCompletionProcInfo, (thePBptr))
  1018. #define CallXPPCompletionProc(userRoutine, thePBptr)        \
  1019.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppXPPCompletionProcInfo, (thePBptr))
  1020. #define CallAttnRoutineProc(userRoutine, sessRefnum, attnBytes)        \
  1021.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppAttnRoutineProcInfo, (sessRefnum), (attnBytes))
  1022. #define CallMPPProtocolHandlerProc(userRoutine, SCCAddr1, SCCAddr2, MPPLocalVars, nextFreeByteInRHA, ReadPacketAndReadRestPtr, numBytesLeftToReadInPacket)        \
  1023.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMPPProtocolHandlerProcInfo, (SCCAddr1), (SCCAddr2), (MPPLocalVars), (nextFreeByteInRHA), (ReadPacketAndReadRestPtr), (numBytesLeftToReadInPacket))
  1024. #define CallDDPSocketListenerProc(userRoutine, SCCAddr1, SCCAddr2, MPPLocalVars, nextFreeByteInRHA, ReadPacketAndReadRestPtr, packetDestinationNumber, numBytesLeftToReadInPacket)        \
  1025.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDDPSocketListenerProcInfo, (SCCAddr1), (SCCAddr2), (MPPLocalVars), (nextFreeByteInRHA), (ReadPacketAndReadRestPtr), (packetDestinationNumber), (numBytesLeftToReadInPacket))
  1026. #else
  1027. #define CallATalkTransitionEventProc(userRoutine, eventCode, qElem, eventParameter)        \
  1028.         (*(userRoutine))((eventCode), (qElem), (eventParameter))
  1029. /* (*MPPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1030. /* (*ATPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1031. /* (*XPPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1032. /* (*AttnRoutineProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1033. /* (*MPPProtocolHandlerProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1034. /* (*DDPSocketListenerProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1035. #endif
  1036.  
  1037. extern pascal OSErr OpenXPP(short *xppRefnum);
  1038. extern pascal OSErr ASPOpenSession(XPPParmBlkPtr thePBptr, Boolean async);
  1039. extern pascal OSErr ASPCloseSession(XPPParmBlkPtr thePBptr, Boolean async);
  1040. extern pascal OSErr ASPAbortOS(XPPParmBlkPtr thePBptr, Boolean async);
  1041. extern pascal OSErr ASPGetParms(XPPParmBlkPtr thePBptr, Boolean async);
  1042. extern pascal OSErr ASPCloseAll(XPPParmBlkPtr thePBptr, Boolean async);
  1043. extern pascal OSErr ASPUserWrite(XPPParmBlkPtr thePBptr, Boolean async);
  1044. extern pascal OSErr ASPUserCommand(XPPParmBlkPtr thePBptr, Boolean async);
  1045. extern pascal OSErr ASPGetStatus(XPPParmBlkPtr thePBptr, Boolean async);
  1046. #define ASPGetStatusSync(paramBlock) ASPGetStatus((paramBlock), FALSE)
  1047. extern pascal OSErr AFPCommand(XPPParmBlkPtr thePBptr, Boolean async);
  1048. extern pascal OSErr GetLocalZones(XPPParmBlkPtr thePBptr, Boolean async);
  1049. extern pascal OSErr GetZoneList(XPPParmBlkPtr thePBptr, Boolean async);
  1050. extern pascal OSErr GetMyZone(XPPParmBlkPtr thePBptr, Boolean async);
  1051. extern pascal OSErr PAttachPH(MPPPBPtr thePBptr, Boolean async);
  1052. extern pascal OSErr PDetachPH(MPPPBPtr thePBptr, Boolean async);
  1053. extern pascal OSErr PWriteLAP(MPPPBPtr thePBptr, Boolean async);
  1054. extern pascal OSErr POpenSkt(MPPPBPtr thePBptr, Boolean async);
  1055. extern pascal OSErr PCloseSkt(MPPPBPtr thePBptr, Boolean async);
  1056. extern pascal OSErr PWriteDDP(MPPPBPtr thePBptr, Boolean async);
  1057. extern pascal OSErr PRegisterName(MPPPBPtr thePBptr, Boolean async);
  1058. extern pascal OSErr PLookupName(MPPPBPtr thePBptr, Boolean async);
  1059. #define PLookupNameSync(paramBlock) PLookupName((paramBlock), FALSE)
  1060. extern pascal OSErr PConfirmName(MPPPBPtr thePBptr, Boolean async);
  1061. extern pascal OSErr PRemoveName(MPPPBPtr thePBptr, Boolean async);
  1062. extern pascal OSErr PSetSelfSend(MPPPBPtr thePBptr, Boolean async);
  1063. extern pascal OSErr PKillNBP(MPPPBPtr thePBptr, Boolean async);
  1064. extern pascal OSErr PGetAppleTalkInfo(MPPPBPtr thePBptr, Boolean async);
  1065. extern pascal OSErr PATalkClosePrep(MPPPBPtr thePBptr, Boolean async);
  1066. extern pascal OSErr POpenATPSkt(ATPPBPtr thePBptr, Boolean async);
  1067. extern pascal OSErr PCloseATPSkt(ATPPBPtr thePBPtr, Boolean async);
  1068. extern pascal OSErr PSendRequest(ATPPBPtr thePBPtr, Boolean async);
  1069. extern pascal OSErr PGetRequest(ATPPBPtr thePBPtr, Boolean async);
  1070. extern pascal OSErr PSendResponse(ATPPBPtr thePBPtr, Boolean async);
  1071. extern pascal OSErr PAddResponse(ATPPBPtr thePBPtr, Boolean async);
  1072. extern pascal OSErr PRelTCB(ATPPBPtr thePBPtr, Boolean async);
  1073. extern pascal OSErr PRelRspCB(ATPPBPtr thePBPtr, Boolean async);
  1074. extern pascal OSErr PNSendRequest(ATPPBPtr thePBPtr, Boolean async);
  1075. extern pascal OSErr PKillSendReq(ATPPBPtr thePBPtr, Boolean async);
  1076. extern pascal OSErr PKillGetReq(ATPPBPtr thePBPtr, Boolean async);
  1077. extern pascal OSErr ATPKillAllGetReq(ATPPBPtr thePBPtr, Boolean async);
  1078. extern pascal void BuildLAPwds(Ptr wdsPtr, Ptr dataPtr, short destHost, short prototype, short frameLen);
  1079. extern pascal void BuildDDPwds(Ptr wdsPtr, Ptr headerPtr, Ptr dataPtr, AddrBlock netAddr, short ddpType, short dataLen);
  1080. extern pascal void NBPSetEntity(Ptr buffer, ConstStr32Param nbpObject, ConstStr32Param nbpType, ConstStr32Param nbpZone);
  1081. extern pascal void NBPSetNTE(Ptr ntePtr, ConstStr32Param nbpObject, ConstStr32Param nbpType, ConstStr32Param nbpZone, short socket);
  1082. extern pascal short GetBridgeAddress(void);
  1083. extern pascal short BuildBDS(Ptr buffPtr, Ptr bdsPtr, short buffSize);
  1084. extern pascal OSErr MPPOpen(void);
  1085. extern pascal OSErr LAPAddATQ(ATQEntryPtr theATQEntry);
  1086. extern pascal OSErr LAPRmvATQ(ATQEntryPtr theATQEntry);
  1087. extern pascal OSErr ATPLoad(void);
  1088. extern pascal OSErr ATPUnload(void);
  1089. extern pascal OSErr NBPExtract(Ptr theBuffer, short numInBuf, short whichOne, EntityName *abEntity, AddrBlock *address);
  1090. extern pascal OSErr GetNodeAddress(short *myNode, short *myNet);
  1091. extern pascal Boolean IsMPPOpen(void);
  1092. extern pascal Boolean IsATPOpen(void);
  1093. extern pascal void ATEvent(long event, Ptr infoPtr);
  1094. extern pascal OSErr ATPreFlightEvent(long event, long cancel, Ptr infoPtr);
  1095. /*
  1096.     The following routines are obsolete and will not be supported on
  1097.     PowerPC. Equivalent functionality is provided by the routines
  1098.     above.
  1099. */
  1100. #if OLDROUTINENAMES && !GENERATINGCFM
  1101. extern pascal OSErr MPPClose(void);
  1102. extern pascal OSErr LAPOpenProtocol(ABByte theLAPType, Ptr protoPtr);
  1103. extern pascal OSErr LAPCloseProtocol(ABByte theLAPType);
  1104. extern pascal OSErr LAPWrite(ATLAPRecHandle abRecord, Boolean async);
  1105. extern pascal OSErr LAPRead(ATLAPRecHandle abRecord, Boolean async);
  1106. extern pascal OSErr LAPRdCancel(ATLAPRecHandle abRecord);
  1107. extern pascal OSErr DDPOpenSocket(short *theSocket, Ptr sktListener);
  1108. extern pascal OSErr DDPCloseSocket(short theSocket);
  1109. extern pascal OSErr DDPRead(ATDDPRecHandle abRecord, Boolean retCksumErrs, Boolean async);
  1110. extern pascal OSErr DDPWrite(ATDDPRecHandle abRecord, Boolean doChecksum, Boolean async);
  1111. extern pascal OSErr DDPRdCancel(ATDDPRecHandle abRecord);
  1112. extern pascal OSErr ATPOpenSocket(AddrBlock addrRcvd, short *atpSocket);
  1113. extern pascal OSErr ATPCloseSocket(short atpSocket);
  1114. extern pascal OSErr ATPSndRequest(ATATPRecHandle abRecord, Boolean async);
  1115. extern pascal OSErr ATPRequest(ATATPRecHandle abRecord, Boolean async);
  1116. extern pascal OSErr ATPReqCancel(ATATPRecHandle abRecord, Boolean async);
  1117. extern pascal OSErr ATPGetRequest(ATATPRecHandle abRecord, Boolean async);
  1118. extern pascal OSErr ATPSndRsp(ATATPRecHandle abRecord, Boolean async);
  1119. extern pascal OSErr ATPAddRsp(ATATPRecHandle abRecord);
  1120. extern pascal OSErr ATPResponse(ATATPRecHandle abRecord, Boolean async);
  1121. extern pascal OSErr ATPRspCancel(ATATPRecHandle abRecord, Boolean async);
  1122. extern pascal OSErr NBPRegister(ATNBPRecHandle abRecord, Boolean async);
  1123. extern pascal OSErr NBPLookup(ATNBPRecHandle abRecord, Boolean async);
  1124. extern pascal OSErr NBPConfirm(ATNBPRecHandle abRecord, Boolean async);
  1125. extern pascal OSErr NBPRemove(EntityPtr abEntity);
  1126. extern pascal OSErr NBPLoad(void);
  1127. extern pascal OSErr NBPUnload(void);
  1128. #endif
  1129.  
  1130. #ifdef __CFM68K__
  1131. #pragma lib_export off
  1132. #endif
  1133.  
  1134. #if GENERATINGPOWERPC
  1135. #pragma options align=reset
  1136. #endif
  1137.  
  1138. #ifdef __cplusplus
  1139. }
  1140. #endif
  1141.  
  1142. #endif /* __APPLETALK__ */
  1143.